<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>中间人详情</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
        <form id="cst_mid_detail_form">
            <div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
                <div class="fieldBox col_50">
                    <div class="label">姓名</div>
                    <div class="field">
                        <span id="mNm" name="mNm"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">手机号</div>
                    <div class="field">
                         <span id="mMp" name="mMp"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">身份证号</div>
                    <div class="field">
                        <span id="mIdNo" name="mIdNo"></span>
                    </div>
                </div>
                
                <div class="fieldBox col_100">
                    <div class="label">备注</div>
                    <div class="field">
                         <span id="mRem" name="mRem"></span>
                    </div>
                </div>
                <!-- hide data -->
		        <div class="fieldBox col_100" style="display:none;">
		          <div class="field">
		              <input name="mId" id="mId" type="text" class="ui-textbox" value="${mId}">
		          </div>
		        </div>
            </div>
        </form>
	<script>
		$(function() {
			initForm();
	        initData();
	        cacelEvent();
		});
		
		 //取消
		function cacelEvent(){
	        $("#cst_mid_detail_form_cancel_btn_id").click(function(event) {
	        	frameElement.dialog.close();
	        });
		}
		 
		//父级窗口回调
		frameElement.dialog.onCancel = function () {
			frameElement.dialog.close();
		}
		
		//初始化表单
		function initForm(){
			 $("#cst_mid_detail_form").ligerForm({
	                validate: true
	           });
		}
		
		//初始化数据
		function initData(){
			var mId = $("#mId").val();
	    	if(!mId)return;
	    	var wait_dialog= $.ligerDialog.SQalert({
	            content: LogUtils.LOG_CMM_LOADING,
	            SQ_type: "waitting",
	            onClose: function () {
	            }
	        });
	    	var _url = '<%=path%>/customer/cstmidmaninfo/getById.do';
	    	$.ajax({
	    		type: 'get',
	    		dataType:'json',
	    		data:{id:mId},
	    		url: _url,
	    		success:function(msg){
	    			wait_dialog.close();
	    			 if(msg.success == 1){
	    				 setData(msg.data);//设置数据
	    			 }else{
	    				 $.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	    			 }
	    		}
	    	});
    	}
		
		//设置页面数据
	    function setData(data){
	    	$("#mNm").html(data.mnm);
	    	$("#mMp").html(data.mmp);
	    	$("#mIdNo").html(data.midNo);
	    	$("#mRem").html(data.mrem);
		};
	</script>
</body>
</html>